#!/sbin/runscript
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-firewall/firestarter/files/firestarter-1.0.3,v 1.1 2005/05/10 05:43:21 mr_bones_ Exp $

opts="${opts} lock"

# Set the location of the Firestarter script
FIRESTARTER="/etc/firestarter/firestarter.sh"

depend() {
	need net
	use logger
	provide firewall
}

checkscript() {
	if [ ! -f $FIRESTARTER ] ; then
		eerror "$FIRESTARTER not found!"
		eerror "Run /usr/bin/firestarter as root and"
		eerror "use the wizard to create a firewall policy."
		return 1
	fi
}

start() {
	checkscript || return 1
	ebegin "Starting Firestarter"
	$FIRESTARTER start
	eend $?
}

stop() {
	checkscript || return 1
	ebegin "Stopping Firestarter"
	$FIRESTARTER stop
	eend $?
}

lock() {
	checkscript || return 1
	ebegin "Locking Firestarter"
	$FIRESTARTER lock
	eend $?
}

status() {
	checkscript || return 1
	einfo "Firestarter status: `$FIRESTARTER status`"
}
